<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../style.css" type="text/css" media="screen">
<link rel="stylesheet" href="../../print.css" type="text/css" media="print">
<meta content="FlxState,org.flixel.FlxState,bgColor,defaultGroup,screen,add,collide,create,destroy,postProcess,preProcess,render,update" name="keywords">
<title>org.flixel.FlxState</title>
</head>
<body>
<script type="text/javascript" language="javascript" src="../../asdoc.js"></script><script type="text/javascript" language="javascript" src="../../cookies.js"></script><script type="text/javascript" language="javascript">
<!--
				asdocTitle = 'FlxState - API Documentation';
				var baseRef = '../../';
				window.onload = configPage;
			--></script>
<table style="display:none" id="titleTable" cellspacing="0" cellpadding="0" class="titleTable">
<tr>
<td align="left" class="titleTableTitle">API Documentation</td><td align="right" class="titleTableTopNav"><a onclick="loadClassListFrame('../../all-classes.html')" href="../../package-summary.html">All&nbsp;Packages</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../all-classes.html')" href="../../class-summary.html">All&nbsp;Classes</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../index-list.html')" href="../../all-index-A.html">Index</a>&nbsp;|&nbsp;<a href="../../index.html?org/flixel/FlxState.html&amp;org/flixel/class-list.html" id="framesLink1">Frames</a><a onclick="parent.location=document.location" href="" style="display:none" id="noFramesLink1">No&nbsp;Frames</a></td><td rowspan="3" align="right" class="titleTableLogo"><img alt="Adobe Logo" title="Adobe Logo" class="logoImage" src="../../images/logo.jpg"></td>
</tr>
<tr class="titleTableRow2">
<td align="left" id="subTitle" class="titleTableSubTitle">Class&nbsp;FlxState</td><td align="right" id="subNav" class="titleTableSubNav"><a href="#propertySummary">Properties</a>&nbsp;| <a href="#methodSummary">Methods</a></td>
</tr>
<tr class="titleTableRow3">
<td colspan="2">&nbsp;</td>
</tr>
</table>
<script type="text/javascript" language="javascript">
<!--
if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Class FlxState"); titleBar_setSubNav(false,true,false,false,false,false,true,false,false,false,false,false,false,false);}
--></script>
<div class="MainContent">
<table cellspacing="0" cellpadding="0" class="classHeaderTable">
<tr>
<td class="classHeaderTableLabel">Package</td><td><a onclick="javascript:loadClassListFrame('class-list.html')" href="package-detail.html">org.flixel</a></td>
</tr>
<tr>
<td class="classHeaderTableLabel">Class</td><td class="classSignature">public class FlxState</td>
</tr>
<tr>
<td class="classHeaderTableLabel">Inheritance</td><td class="inheritanceList">FlxState <img class="inheritArrow" alt="Inheritance" title="Inheritance" src="../../images/inherit-arrow.gif"> flash.display.Sprite</td>
</tr>
</table>
<p></p>
  This is the basic game "state" object - e.g. in a simple game
  you might have a menu state and a play state.
  It acts as a kind of container for all your game objects.
  You can also access the game's background color
  and screen buffer through this object.
  FlxState is kind of a funny class from the technical side,
  it is just a regular Flash Sprite display object,
  with one member variable: a flixel <code>FlxGroup</code>.
  This means you can load it up with regular Flash stuff
  or with flixel elements, whatever works!
  <p></p>
<br>
<hr>
</div>
<a name="propertySummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Properties</div>
<table id="summaryTableProperty" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Property</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#bgColor">bgColor</a> : uint<div class="summaryTableDescription">[static]
   This static variable indicates the "clear color"
   or default background color of the game.</div>
</td><td class="summaryTableOwnerCol">FlxState</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#defaultGroup">defaultGroup</a> : <a href="../flixel/FlxGroup.html">FlxGroup</a>
<div class="summaryTableDescription">
   Internal group used to organize and display objects you add to this state.</div>
</td><td class="summaryTableOwnerCol">FlxState</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#screen">screen</a> : <a href="../flixel/FlxSprite.html">FlxSprite</a>
<div class="summaryTableDescription">[static]
   This static variable holds the screen buffer,
   so you can draw to it directly if you want.</div>
</td><td class="summaryTableOwnerCol">FlxState</td>
</tr>
</table>
</div>
<a name="methodSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Methods</div>
<table id="summaryTableMethod" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#FlxState()">FlxState</a>()</div>
<div class="summaryTableDescription">
   Creates a new <code>FlxState</code> object,
   instantiating <code>screen</code> if necessary.</div>
</td><td class="summaryTableOwnerCol">FlxState</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#add()">add</a>(Core:<a href="FlxObject.html">FlxObject</a>):<a href="../flixel/FlxObject.html">FlxObject</a>
</div>
<div class="summaryTableDescription">
   Adds a new FlxCore subclass (FlxSprite, FlxBlock, etc) to the game loop.</div>
</td><td class="summaryTableOwnerCol">FlxState</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#collide()">collide</a>():void</div>
<div class="summaryTableDescription">
   This function collides <code>defaultGroup</code> against <code>defaultGroup</code>
   (basically everything you added to this state).</div>
</td><td class="summaryTableOwnerCol">FlxState</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#create()">create</a>():void</div>
<div class="summaryTableDescription">
   Override this function to set up your game state.</div>
</td><td class="summaryTableOwnerCol">FlxState</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#destroy()">destroy</a>():void</div>
<div class="summaryTableDescription">
   Override this function to handle any deleting or "shutdown" type operations you
   might need (such as removing traditional Flash children like Sprite objects).</div>
</td><td class="summaryTableOwnerCol">FlxState</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#postProcess()">postProcess</a>():void</div>
<div class="summaryTableDescription">
   Override this function to do special pre-processing FX like light bloom.</div>
</td><td class="summaryTableOwnerCol">FlxState</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#preProcess()">preProcess</a>():void</div>
<div class="summaryTableDescription">
   Override this function to do special pre-processing FX like motion blur.</div>
</td><td class="summaryTableOwnerCol">FlxState</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#render()">render</a>():void</div>
<div class="summaryTableDescription">
   Automatically goes through and calls render on everything you added to the game loop,
   override this loop to manually control the rendering process.</div>
</td><td class="summaryTableOwnerCol">FlxState</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#update()">update</a>():void</div>
<div class="summaryTableDescription">
   Automatically goes through and calls update on everything you added to the game loop,
   override this function to handle custom input and perform collisions/
   </div>
</td><td class="summaryTableOwnerCol">FlxState</td>
</tr>
</table>
</div>
<script type="text/javascript" language="javascript">
<!--
showHideInherited();
--></script>
<div class="MainContent">
<a name="propertyDetail"></a>
<div class="detailSectionHeader">Property detail</div>
<a name="bgColor"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">bgColor</td><td class="detailHeaderType">property</td>
</tr>
</table>
<div class="detailBody">
<code>public static var bgColor:uint</code><p>
   This static variable indicates the "clear color"
   or default background color of the game.
   Change it at ANY time using <code>FlxState.bgColor</code>.
   </p></div>
<a name="defaultGroup"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">defaultGroup</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public var defaultGroup:<a href="../flixel/FlxGroup.html">FlxGroup</a></code><p>
   Internal group used to organize and display objects you add to this state.
   </p></div>
<a name="screen"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">screen</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static var screen:<a href="../flixel/FlxSprite.html">FlxSprite</a></code><p>
   This static variable holds the screen buffer,
   so you can draw to it directly if you want.
   </p></div>
<a name="constructorDetail"></a>
<div class="detailSectionHeader">Constructor detail</div>
<a name="FlxState()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">FlxState</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">constructor</td>
</tr>
</table>
<div class="detailBody">
<code>public function FlxState()</code><p>
   Creates a new <code>FlxState</code> object,
   instantiating <code>screen</code> if necessary.
   </p></div>
<a name="methodDetail"></a>
<div class="detailSectionHeader">Method detail</div>
<a name="add()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">add</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td>
</tr>
</table>
<div class="detailBody">
<code>public function add(Core:<a href="FlxObject.html">FlxObject</a>):<a href="../flixel/FlxObject.html">FlxObject</a></code><p>
   Adds a new FlxCore subclass (FlxSprite, FlxBlock, etc) to the game loop.
   FlxState is adding this object to its built-in FlxGroup to automate updating and rendering.
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">Core</span>:<a href="FlxObject.html">FlxObject</a></code> &mdash; The object you want to add to the game loop.
   </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code><a href="../flixel/FlxObject.html">FlxObject</a></code></td>
</tr>
</table>
</div>
<a name="collide()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">collide</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function collide():void</code><p>
   This function collides <code>defaultGroup</code> against <code>defaultGroup</code>
   (basically everything you added to this state).
   </p></div>
<a name="create()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">create</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function create():void</code><p>
   Override this function to set up your game state.
   This is where you create your groups and game objects and all that good stuff.
   </p></div>
<a name="destroy()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">destroy</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function destroy():void</code><p>
   Override this function to handle any deleting or "shutdown" type operations you
   might need (such as removing traditional Flash children like Sprite objects).
   </p></div>
<a name="postProcess()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">postProcess</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function postProcess():void</code><p>
   Override this function to do special pre-processing FX like light bloom.
   You can use scaling or blending modes or whatever you want against
   <code>FlxState.screen</code> to achieve all sorts of cool FX.
   </p></div>
<a name="preProcess()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">preProcess</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function preProcess():void</code><p>
   Override this function to do special pre-processing FX like motion blur.
   You can use scaling or blending modes or whatever you want against
   <code>FlxState.screen</code> to achieve all sorts of cool FX.
   </p></div>
<a name="render()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">render</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function render():void</code><p>
   Automatically goes through and calls render on everything you added to the game loop,
   override this loop to manually control the rendering process.
   </p></div>
<a name="update()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">update</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function update():void</code><p>
   Automatically goes through and calls update on everything you added to the game loop,
   override this function to handle custom input and perform collisions/
   </p></div>
<br>
<br>
<hr>
<br>
<p></p>
<center class="copyright"> 
</center>
</div>
</body>
</html>
<!-- -->
